<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="template">
<meta name="author" content="hyosong">
<link href="/${initParam.context_root }/css/starter-template3.css" rel="stylesheet">
<link media="screen" rel="stylesheet" href="/${initParam.context_root }/css/bootstrap.min.css">
<title>Message Box</title>
<script type="text/javascript">
	if ('${requestScope.check_num }') {

		alert("전송이 완료되었습니다.");
	}
</script>
</head>
<body>

<div class="container">
		<div class="starter-template">
			<ul class="nav nav-tabs">
				<li role="presentation" ><a href="/${initParam.context_root }/message/messageBox.do?id=${sessionScope.login_info.id}">받은 쪽지함</a></li>
				<li role="presentation" class="active"><a
					href="/${initParam.context_root }/message/sendMessageBox.do?id=${sessionScope.login_info.id}">보낸 쪽지함</a></li>
			</ul>

	<!-- 테이블 유아이 처리 -->
<br>
			<table class="table table-hover" cellpadding='0' cellspacing='0'>
				<thead>
				<tr>
					<td width="65px"><strong>No</strong></td>
					<td><strong>쪽지 제목</strong></td>
					<td width="100px"><strong>보낸 사람</strong></td>
					<td width="100px"><strong>작성일</strong></td>
				</tr>
				</thead>
				<c:forEach items="${requestScope.list }" var="board">
					<tr>
						<td>${board.num }</td>
						<td><a href="/${initParam.context_root }/message/getContent.do?num=${board.num }&flag=1"
							id="title"> ${board.title } </a></td>
						<td>${board.fromId }</td>
						<td>${board.days }</td>
					</tr>
				</c:forEach>
			</table>
			
			
			<p>
	
	<nav>

				<ul class="pagination">
					<c:choose>
						<c:when test="${requestScope.pagingBean.previousPageGroup }">
							<li class="disabled"><a
								href="/${initParam.context_root }/message/sendMessageBox.do?page=${requestScope.pagingBean.startPageOfPageGroup -1 }&id=${sessionScope.login_info.id}"><span
									aria-hidden="true">&laquo;</span><span class="sr-only">Previous</span></a></li>
						</c:when>
						<c:otherwise>
							<li class="disabled"><a href="#"><span aria-hidden="true">&laquo;</span><span
									class="sr-only">Previous</span></a></li>

						</c:otherwise>
					</c:choose>

					<c:forEach begin="${requestScope.pagingBean.startPageOfPageGroup }"
						end="${requestScope.pagingBean.endPageOfPageGroup }" step="1" var="i">
						<c:choose>
							<c:when test="${i == requestScope.pagingBean.currentPage }">
								<li class="active"><a href="#">${i } <span class="sr-only">(current)</span></a></li>
							</c:when>
							<c:otherwise>
								<li><a
									href="/${initParam.context_root }/message/sendMessageBox.do?page=${i }&id=${sessionScope.login_info.id}">${i }
										<span class="sr-only">(current)</span>
								</a></li>
							</c:otherwise>
						</c:choose>
					</c:forEach>
					<c:choose>
						<c:when test="${requestScope.pagingBean.nextPageGroup }">
							<li><a
								href="/${initParam.context_root }/message/sendMessageBox.do?page=${requestScope.pagingBean.endPageOfPageGroup + 1 }&id=${sessionScope.login_info.id}"><span
									aria-hidden="true">&raquo;</span><span class="sr-only">Next</span></a></li>
						</c:when>
						<c:otherwise>
							<li class="disabled"><a href="#"><span aria-hidden="true">&raquo;</span><span
									class="sr-only">Next</span></a></li>
						</c:otherwise>
					</c:choose>
				</ul>
				</nav>
		</div>
	</div>

</body>
</html>